﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SetPostion : MonoBehaviour
{
    public Transform[] source;
    public Transform[] target;

    // Start is called before the first frame update
    void Start()
    {
        
    }

    [ContextMenu("SetPosTo")]
    void SetPosTo()
    {
        if (source.Length != target.Length) return;

        for (int i = 0; i < source.Length; i++)
        {
            target[i].position = source[i].position;
            target[i].rotation = source[i].rotation; 
            target[i].localScale = source[i].localScale;
        }
         
    }

    [ContextMenu("RevertX")]
    void RevertX()
    {
        for (int i = 0; i < transform.childCount; i++)
        {
            var pos = transform.GetChild(i).localPosition;
            pos.x = - pos.x;
            transform.GetChild(i).localPosition = pos;
        }
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
